const createWorker = require('./build-tools/woker_thread');
const path = require('path')

// 创建一个子线程并执行指定文件
let funPath =  path.resolve('./log.js')
console.log('funPath',funPath)
const worker = createWorker(funPath, {}, 1, 2, 3);

// 发送消息通知子线程执行完毕
worker.postMessage('run function');

// 在一定时间后关闭子线程
setTimeout(() => {
    worker.terminate();
}, 5000);
